//
//  ZHFAuthorDescripthonCell.m
//  GoTraveling
//
//  Created by dllo on 15/12/28.
//  Copyright © 2015年 开发华佗. All rights reserved.
//

#import "ZHFAuthorDescripthonCell.h"

@implementation ZHFAuthorDescripthonCell

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}


-(void)createSubViews{
    
    self.musicImage = [[UIImageView alloc]initWithFrame:self.contentView.bounds];
    [self.contentView addSubview:self.musicImage];
    //区图片中间部分
    self.musicImage.contentMode = UIViewContentModeScaleAspectFill;
    //剪掉边缘
    self.musicImage.clipsToBounds = YES;
    
    
    self.title = [[UILabel alloc]initWithFrame:CGRectMake(0, self.contentView.frame.size.height / 7 * 5.5, self.contentView.frame.size.width, self.contentView.frame.size.height / 7)];
    self.title.textColor = [UIColor whiteColor];
    self.title.font = [UIFont systemFontOfSize:self.contentView.frame.size.height / 7];
    [self.contentView addSubview:self.title];
    
}


-(void)setAuthorDic:(NSMutableDictionary *)authorDic{
    
    self.title.text = [[authorDic objectForKey:@"playInfo"] objectForKey:@"title"];
    NSURL *url = [NSURL URLWithString:[[authorDic objectForKey:@"playInfo"] objectForKey:@"imgUrl"]];
    [self.musicImage sd_setImageWithURL:url placeholderImage:nil];
}


@end
